package com.ytjj.qmyx.admin.dao;

import com.ytjj.qmyx.admin.model.data.response.*;
import com.ytjj.qmyx.admin.model.request.UserStatisticsRequest;
import com.ytjj.qmyx.admin.model.response.ProductDataResponse;
import com.ytjj.qmyx.admin.model.response.UserOrderAnalysisResponse;
import com.ytjj.qmyx.admin.model.response.statistics.*;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description TODO
 * @ClassName OrderStatisticsMapper
 *
 *
 * @Version 1.0
 **/
public interface OrderStatisticsMapper {

    OrderResponse getOrderNum(DateResponse dateResponse);

    List<ProductResponse> getOrderRank(DateResponse dateResponse);

    List<OrderStatisticResponse> getOrderDataByHour(DateResponse dateResponse);

    List<OrderStatisticResponse> getOrderDataByWeekAndMonth(DateResponse dateResponse);

    List<ProductSpecialResponse> getProductSpecialList(DateResponse dateResponse);

    ProductDataResponse getProductDataList(@Param("productId") Integer productId,
                                           @Param("channel") String channel,
                                           @Param("platform") String platform,
                                           @Param("startTime") Date startTime,
                                           @Param("endTime") Date endTime);

    ProductDataResponse getPrice(@Param("productId") Integer productId);

    List<NewOrderStatisticsResponse> getNewOrderStatisticsList(@Param("channel") String channel,
                                                               @Param("order_source") String order_source,
                                                               @Param("startTime") Date startTime,
                                                               @Param("endTime") Date endTime,
                                                               @Param("activityType") String activityType,
                                                               @Param("channelList") List<String> channelList,
                                                               @Param("scene") String scene,
                                                               @Param("account")String account);
    List<NewStatisticsResponse> getFinancialExport(@Param("startTime") Date startTime,@Param("endTime") Date endTime,@Param("promotionChannel")Integer promotionChannel);

    List<AreaTimePeriodResponse> getChannelStatisticsList(@Param("channels") List<String> channels,
                                                             @Param("startTime") Date startTime,
                                                             @Param("endTime") Date endTime);
    List<AreaTimePeriodResponse> getProvinceStatisticsList(@Param("channels") List<String> channels,
                                                             @Param("startTime") Date startTime,
                                                             @Param("endTime") Date endTime);

    List<AreaTimePeriodResponse> getHourStatisticsList(@Param("channels") List<String> channels,
                                                             @Param("startTime") Date startTime,
                                                             @Param("endTime") Date endTime);
    AreaTimePeriodResponse getTotalStatistics(@Param("channels") List<String> channels,
                                                       @Param("startTime") Date startTime,
                                                       @Param("endTime") Date endTime);

    List<AreaTimePeriodResponse> getProvinceStatisticsOthers(@Param("channels") List<String> channels,
                                                       @Param("startTime") Date startTime,
                                                       @Param("endTime") Date endTime);

    List<Map<String,Object>> getPayNumForUserStatistics(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("type") Integer type);

    List<UserPayStatisticsResponse> getPayNumForUser(@Param("startTime") String startTime, @Param("endTime") String endTime);


    /**
     * 下单偏好-省份统计
     */
    List<UserOrderAnalysisResponse> getOrderStatisticsByProvince(@Param("request") UserStatisticsRequest request,@Param("list") List<String> list);

    /**
     * 下单偏好-商品类目
     */
    List<UserOrderAnalysisResponse> getOrderStatisticsByCategory(@Param("request") UserStatisticsRequest request,@Param("list") List<String> list);

    /**
     * 下单偏好-客单价
     */
    List<UserOrderAnalysisResponse> getOrderStatisticsByPrice(@Param("request") UserStatisticsRequest request, @Param("list") List<String> list,
                                                              @Param("startPrice") BigDecimal startPrice, @Param("endPrice") BigDecimal endPrice);

    /**
     * 复购偏好-省份统计
     */
    List<UserOrderAnalysisResponse> getRepurchaseStatisticsByProvince(@Param("request") UserStatisticsRequest request,@Param("list") List<String> list);

    /**
     * 复购偏好-类目统计
     */
    List<UserOrderAnalysisResponse> getRepurchaseStatisticsByCategory(@Param("request") UserStatisticsRequest request,@Param("list") List<String> list);

    /**
     * 复购偏好-客单价统计
     */
    List<UserOrderAnalysisResponse> getRepurchaseStatisticsByPrice(@Param("request") UserStatisticsRequest request,@Param("list") List<String> list,
                                                                   @Param("startPrice") BigDecimal startPrice, @Param("endPrice") BigDecimal endPrice);



    List<AreaCostMoneyResponse> getProvinceCostMoneyStatisticsList(@Param("channels") List<String> channels,
                                                                   @Param("startTime") Date startTime,
                                                                   @Param("endTime") Date endTime);
    BigDecimal getTotalCostMoneyStatisticsList(@Param("channels") List<String> channels,
                                               @Param("startTime") Date startTime,
                                               @Param("endTime") Date endTime);

    List<RedPacketResponse> findNum1(String startDate,String endDate);

    List<RedPacketResponse> findNum2(String startDate,String endDate);
}
